package com.ziiwee.reduce.describe.models;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ziiwee.reduce.describe.FieldDescribe;
import com.ziiwee.reduce.describe.TypeDescribe;
import org.springframework.core.ResolvableType;

import java.util.List;

/**
 * @author ziiwee
 * @data 2020/8/12
 */
public class TypeDescribeModel implements TypeDescribe {

    private String name;
    @JsonSerialize(using = ResolvableTypeSerializer.class)
    private ResolvableType type;
    private String label;
    private String description;

    List<FieldDescribe> fields;

    public TypeDescribeModel(String name, ResolvableType type, String label, String description, List<FieldDescribe> fields) {
        this.name = name;
        this.type = type;
        this.label = label;
        this.description = description;
        this.fields = fields;
    }

    @Override
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public ResolvableType getType() {
        return type;
    }

    public void setType(ResolvableType type) {
        this.type = type;
    }

    @Override
    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    @Override
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public List<FieldDescribe> getFields() {
        return fields;
    }

    public void setFields(List<FieldDescribe> fields) {
        this.fields = fields;
    }
}
